import sys
from PySide6 import QtCore
from PySide6.QtWidgets import QApplication 
from PySide6.QtUiTools import QUiLoader

loader = QUiLoader()

class MainUi(QtCore.QObject):
    def __init__(self):
        super().__init__()
        self.ui = loader.load("mainwindow.ui", None)
        self.ui.setWindowTitle("MainWindow Title")
        self.ui.show()

app = QApplication(sys.argv)
ui = MainUi()
app.exec()